/*
    $Header: /Windows/Shell/ShellExt.root/ShellExt/src/COvlIcon.h 1     08-01-05 0:08 Ken $
    $Log: /Windows/Shell/ShellExt.root/ShellExt/src/COvlIcon.h $
 * 
 * 1     08-01-05 0:08 Ken
*/


#pragma once
#include "resource.h"       // main symbols

#include "ShellExt.h"
#include "CIShellExtImp.h"

#define ICON_LNK_INDEX    0

// COvlIcon

class ATL_NO_VTABLE COvlIcon :
    public CComObjectRootEx<CComSingleThreadModel>,
    public CComCoClass<COvlIcon, &CLSID_OvlIcon>,
    public IDispatchImpl<IOvlIcon, &IID_IOvlIcon, &LIBID_ShellExtLib, /*wMajor =*/ 1, /*wMinor =*/ 0>
    ,public CIShlIconImp
{
public:
    COvlIcon()
    :CIShlIconImp(g_hInstance, ICON_LNK_INDEX)
    {
    }

DECLARE_REGISTRY_RESOURCEID(IDR_OVLICON)


BEGIN_COM_MAP(COvlIcon)
    COM_INTERFACE_ENTRY(IOvlIcon)
    COM_INTERFACE_ENTRY(IDispatch)
    COM_INTERFACE_ENTRY(IShellIconOverlayIdentifier)
END_COM_MAP()


    DECLARE_PROTECT_FINAL_CONSTRUCT()

    HRESULT FinalConstruct()
    {
        return S_OK;
    }

    void FinalRelease()
    {
    }

// IShellIconOverlayIdentifier
public:
    STDMETHOD(IsMemberOf)( LPCWSTR pwszPath, DWORD dwAttrib );


};

OBJECT_ENTRY_AUTO(__uuidof(OvlIcon), COvlIcon)


// COvlIconErr
#define ICON_LNKERR_INDEX 1
class ATL_NO_VTABLE COvlIconErr :
    public CComObjectRootEx<CComSingleThreadModel>,
    public CComCoClass<COvlIconErr, &CLSID_OvlIconErr>,
    public IDispatchImpl<IOvlIconErr, &IID_IOvlIconErr, &LIBID_ShellExtLib, /*wMajor =*/ 1, /*wMinor =*/ 0>
    ,public CIShlIconImp
{
public:
    COvlIconErr()
    :CIShlIconImp(g_hInstance, ICON_LNKERR_INDEX)
    {
    }

DECLARE_REGISTRY_RESOURCEID(IDR_OVLICONERR)


BEGIN_COM_MAP(COvlIconErr)
    COM_INTERFACE_ENTRY(IOvlIconErr)
    COM_INTERFACE_ENTRY(IDispatch)
    COM_INTERFACE_ENTRY(IShellIconOverlayIdentifier)
END_COM_MAP()


    DECLARE_PROTECT_FINAL_CONSTRUCT()

    HRESULT FinalConstruct()
    {
        return S_OK;
    }

    void FinalRelease()
    {
    }

// IShellIconOverlayIdentifier
public:
    STDMETHOD(IsMemberOf)( LPCWSTR pwszPath, DWORD dwAttrib );

};

OBJECT_ENTRY_AUTO(__uuidof(OvlIconErr), COvlIconErr)
